import React from 'react'

/**
 * 搜索条
 *
 * @author leonzhangxf 20190117
 */
class SearchAreaSearch extends React.Component {
  constructor(props) {
    super(props);

    this.handleSearchChange = this.handleSearchChange.bind(this);
  }

  handleSearchChange(event) {
    if (this.props.onSearchChange) {
      this.props.onSearchChange(event.target.value);
    }
  }

  render() {
    let searchValue = this.props.value;
    return (
      <div>
        <input className="SearchArea-Search"
               type="text" name="search" value={searchValue}
               placeholder="Search..."
               onChange={this.handleSearchChange}
        />
      </div>
    );
  }
}

export default SearchAreaSearch;